#include "adc.h"



void adc_test(void)
{
    int val = 0;
    double vol = 0.0;
    int m , n;
    adc_init();
    while(1)
    {
        val =  adc_read_ain0();
        vol = (double) (val / 1023) * 3.3;
        m = (int )vol;
        vol = vol - m;
        n = vol *1000;

        /* 在串口 打印数据 */
        printf("vol =  %d.%03d V", m, n);
    }
}
